// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov  Date: 2008-7-12 11:33:31
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   t_role_QueryMap.java

package com.creawor.hz_market.t_role;

import com.creawor.hz_market.servlet.LoadMapInfoAjax;
import com.creawor.imei.base.AbsQueryMap;
import java.io.PrintStream;
import java.util.Iterator;
import java.util.List;

import org.apache.log4j.Logger;

import net.sf.hibernate.*;

// Referenced classes of package com.creawor.hz_market.t_role:
//            t_role_Form, t_role

public class t_role_QueryMap extends AbsQueryMap
{
	private static final Logger logger = Logger.getLogger(LoadMapInfoAjax.class);
    public t_role_QueryMap()
        throws HibernateException
    {
        initSession();
    }

    public List findAll()
        throws HibernateException
    {
        totalrow = ((Integer)session.iterate("select count(*) from t_role").next()).intValue();
        String querystr = "from t_role";
        Query query = session.createQuery(querystr);
        //setQueryPage(query);
        return query.list();
    }

    public t_role_Form getByID(String ID)
        throws HibernateException
    {
        t_role_Form vo = null;
        //System.out.println((new StringBuilder("\n badqiu:")).append(ID).toString());
        //System.out.println((new StringBuilder("\nt_role_QueryMap getByID:")).append(ID).toString());
        logger.debug((new StringBuilder("\nt_role_QueryMap getByID:")).append(ID).toString());
        session.clear();
        try
        {
            vo = new t_role_Form();
            t_role po = (t_role)session.load(t_role.class, new Integer(ID));
            try
            {
                vo.setId(String.valueOf(po.getId()));
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }
            vo.setRole_name(po.getRole_name());
            vo.setDescription(po.getDescription());
        }
        catch(HibernateException e)
        {
            //System.out.println((new StringBuilder("\nERROR in getByID @t_role:")).append(e).toString());
            logger.debug((new StringBuilder("\nERROR in getByID @t_role:")).append(e).toString());
        }
        return vo;
    }
    
    public static void main(String[]args){
    	try {
				t_role_QueryMap query=new t_role_QueryMap();
				List ls=query.findAll();
				System.out.println(ls.size());
			} catch (HibernateException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
    }

    static Class class$0;
}